package com.kedou.sdk.params.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

import java.math.BigDecimal;

public class PayChannel implements Parcelable {

    /**
     * 支付渠道类型ID
     */
    @SerializedName("payment_type")
    private int payType;

    /**
     * 支付渠道类型ID
     */
    @SerializedName("pay_id")
    private int pay_id;

    /**
     * 支付渠道主题
     */
    @SerializedName("title")
    private String title;
    @SerializedName("name")
    private String name;

    /**
     * 支付渠道见到描述信息
     */
    @SerializedName("desc")
    private String description;

    /**
     * 支付渠道icon图标下载地址
     */
    @SerializedName("icon")
    private String iconUrl;

    /**
     * 支付渠道是否默认隐藏
     */
    @SerializedName("ishidden")
    private boolean isHidden;

    /**
     * 货币符号
     */
    @SerializedName("currency")
    private String currency;


    @SerializedName("id")
    private String id;


    /**
     * 货币价格
     */
    @SerializedName("currency_amount")
    private BigDecimal currencyPrice;

//    public PayType getPayTypeEnum() {
//        return PayType.valueOf(payType);
//    }

    public int getPayType() {
        return payType;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public void setPayType(int paymentType) {
        this.payType = paymentType;
    }

    public String getTitle() {
        return title;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getIconUrl() {
        return iconUrl;
    }

    public void setIconUrl(String iconUrl) {
        this.iconUrl = iconUrl;
    }

    public boolean isHidden() {
        return isHidden;
    }

    public void setHidden(boolean hidden) {
        isHidden = hidden;
    }

    public String getCurrency() {
        return currency;
    }

    public void setCurrency(String currency) {
        this.currency = currency;
    }

    public void setCurrencyPrice(BigDecimal currencyPrice) {
        this.currencyPrice = currencyPrice;
    }

    public BigDecimal getCurrencyPrice() {
        return currencyPrice;
    }

    public PayChannel() {
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.payType);
        dest.writeString(this.title);
        dest.writeString(this.description);
        dest.writeString(this.iconUrl);
        dest.writeByte(this.isHidden ? (byte) 1 : (byte) 0);
        dest.writeString(this.currency);
        dest.writeSerializable(this.currencyPrice);

        dest.writeInt(this.pay_id);
        dest.writeString(this.name);
        dest.writeString(this.id);
    }

    protected PayChannel(Parcel in) {
        this.payType = in.readInt();
        this.title = in.readString();
        this.description = in.readString();
        this.iconUrl = in.readString();
        this.isHidden = in.readByte() != 0;
        this.currency = in.readString();
        this.currencyPrice = (BigDecimal) in.readSerializable();

        this.pay_id = in.readInt();
        this.name = in.readString();
        this.id= in.readString();
    }

    public static final Creator<PayChannel> CREATOR = new Creator<PayChannel>() {
        @Override
        public PayChannel createFromParcel(Parcel source) {
            return new PayChannel(source);
        }

        @Override
        public PayChannel[] newArray(int size) {
            return new PayChannel[size];
        }
    };

    public int getPay_id() {
        return pay_id;
    }

    public void setPay_id(int pay_id) {
        this.pay_id = pay_id;
    }
}
